<?php
$this->pageTitle=Yii::app()->name . ' - Thông tin tài khoản';
$this->breadcrumbs = array(
	
);
?>
<div class="well">
	<div class="navbar">
		<div class="navbar-inner"><i class="icon-chevron-right icon-white"></i> Thông tin tài khoản</div>
	</div>
	<div class="row-fluid">
		<div id="tabs">	
		<ul>
			<li><a href="<?php echo Yii::app()->baseUrl?>/user/balanceinfo">Số dư tài khoản</a></li>
			<li><a href="#deposit">Nạp tiền</a></li>
			<li><a href="<?php echo Yii::app()->baseUrl?>/user/payment">Lịch sử giao dịch</a></li>
		</ul>
			<div class="main" id="deposit">
				<div style="margin: 10px">
					<?php
						$form=$this->beginWidget('CActiveForm', array(
							'id'=>'deposit-form',
							'htmlOptions'=>array('class'=>'form-horizontal')
						));  
					?>
					<?php
						$this->widget('ext.ajaxform.JAjaxForm',array(
						    'formId'=>'deposit-form',
						    'options'=>array(
						        'dataType'=>'json',
						        'beforeSubmit'=>'js:function(formData,$form,options) {return before_submit();}',
						        'success'=>'js:function(responseText,statusText) { 
						        	if(responseText.result.error)
							        {
							        	error_submit(responseText.result.error);
							        } 
							        if(responseText.result.success)
							        {
							        	success_submit(responseText.result.success,"");
							        }  
						        }',
										'error'=>'js:function(responseText,statusText) { 
								    	error_submit(responseText.responseText);
						      	}',
						    ),
						)); 
						?>
					<div id="div-result"> </div>
					<div class="clearfix" id="user-payment" style="margin-left: 10px">
						<?php echo $form->radioButtonList($model,'money',array('10000'=>'10000 VND','20000'=>'20000 VND','50000'=>'50000 VND','100000'=>'100000 VND'), 
														array('separator'=>'','template'=>'<div class="clearfix">{input}{label}</div>'))?>
						<label class="control-label">Khuyến mãi</label>
						<?php echo CHtml::dropDownList('promotion', '0', array('0'=>'Không khuyến mãi','50'=>'50%','100'=>'100%'), array('style'=>'width: auto'))?>
					</div>
						<?php echo CHtml::submitButton(Yii::t('default', 'Nạp tiền'), array('class'=>'btn btn-danger')); ?>
					<?php $this->endWidget(); ?>
				</div>
			</div>
		</div><!-- End tabs -->
	</div>
</div>
<script type="text/javascript">
$(function() {
	$( "#tabs" ).tabs({
		beforeLoad: function( event, ui ) {
			ui.jqXHR.error(function() {
				ui.panel.html(
					"Couldn't load this tab. We'll try to fix this as soon as possible. " +
					"If this wouldn't be a demo." );
			});
		},
	});
});
</script>